﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Collections;

namespace MusicLibraryGUI
{
    class PlayList
    {
        private ArrayList _tracks;

        public PlayList()
        {
            _tracks = new ArrayList();
        }

        public ArrayList Tracks()
        {
            return _tracks;
        }

        public void AddTtrack(AudioRecord rec)
        {
            _tracks.Add(rec);
        }

        public void RemoveTrack(int ind)
        {
            _tracks.RemoveAt(ind);
        }

        public int Length()
        {
            return _tracks.Count;
        }

        public double CalculateTime()
        {
            double res = 0.0;
            foreach (AudioRecord rec in _tracks)
            {
                res += rec.Length();
            }
            return res;
        }

        public void ClearList()
        {
            _tracks.Clear();
        }
    }
}
